long_to_cons and cons_to_long are generally useful things; they're
authorJim Blandy <jimb@redhat.com>
Sat, 10 Apr 1993 08:05:07 +0000 (08:05 +0000)
committerJim Blandy <jimb@redhat.com>
Sat, 10 Apr 1993 08:05:07 +0000 (08:05 +0000)
needed whether or not X is defined.
* xselect.c (long_to_cons, cons_to_long): Moved from here...
* data.c    (long_to_cons, cons_to_long): ... to here.
* lisp.h    (long_to_cons, cons_to_long): Add extern declaration.

src/data.c
src/lisp.h
src/xselect.c

index 4b2fa3cebbf2587c75d90282d2b9bb6f5cd841de..66b4e90157b9f59347a89267d66802ded188da88 100644 (file)
@@ -1425,6 +1425,35 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0, "T if NUMBER is zero.")
   return Qnil;
 }
 \f
+/* Convert between 32-bit values and pairs of lispy 24-bit values.  */
+
+Lisp_Object
+long_to_cons (i)
+     unsigned long i;
+{
+  unsigned int top = i >> 16;
+  unsigned int bot = i & 0xFFFF;
+  if (top == 0)
+    return make_number (bot);
+  if (top == 0xFFFF)
+    return Fcons (make_number (-1), make_number (bot));
+  return Fcons (make_number (top), make_number (bot));
+}
+
+unsigned long
+cons_to_long (c)
+     Lisp_Object c;
+{
+  int top, bot;
+  if (INTEGERP (c))
+    return XINT (c);
+  top = XCONS (c)->car;
+  bot = XCONS (c)->cdr;
+  if (CONSP (bot))
+    bot = XCONS (bot)->car;
+  return ((XINT (top) << 16) | XINT (bot));
+}
+\f
 DEFUN ("number-to-string", Fnumber_to_string, Snumber_to_string, 1, 1, 0,
   "Convert NUM to a string by printing it in decimal.\n\
 Uses a minus sign if negative.\n\
index 4e2b86e57ec3c2505a7b012bb5a51da06554e825..a89c5290a69351fc9a3b6ace935cd212f8d91ef0 100644 (file)
@@ -985,6 +985,8 @@ extern Lisp_Object Flsh (), Fash ();
 extern Lisp_Object Fadd1 (), Fsub1 ();
 
 extern Lisp_Object make_number ();
+extern Lisp_Object   long_to_cons ();
+extern unsigned long cons_to_long ();
 extern void args_out_of_range ();
 extern void args_out_of_range_3 ();
 extern Lisp_Object wrong_type_argument ();
index 51592fe728259594808b40055cd2ea6dad64e3dd..bb052ae1ccf1359f7daf3c2d297628e93c770a69 100644 (file)
@@ -234,36 +234,6 @@ x_atom_to_symbol (display, atom)
   return val;
 }
 \f
-/* Convert between full word time values (last modification times, etc)
-   and their Lisp representation as a cons cell (HIGH . LOW).  */
-
-Lisp_Object
-long_to_cons (i)
-     unsigned long i;
-{
-  unsigned int top = i >> 16;
-  unsigned int bot = i & 0xFFFF;
-  if (top == 0)
-    return make_number (bot);
-  if (top == 0xFFFF)
-    return Fcons (make_number (-1), make_number (bot));
-  return Fcons (make_number (top), make_number (bot));
-}
-
-unsigned long
-cons_to_long (c)
-     Lisp_Object c;
-{
-  int top, bot;
-  if (INTEGERP (c))
-    return XINT (c);
-  top = XCONS (c)->car;
-  bot = XCONS (c)->cdr;
-  if (CONSP (bot))
-    bot = XCONS (bot)->car;
-  return ((XINT (top) << 16) | XINT (bot));
-}
-\f
 /* Do protocol to assert ourself as a selection owner.
    Update the Vselection_alist so that we can reply to later requests for 
    our selection.  */